
set(PATH_TO_DRIVER_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/perf_test_driver")
configure_file(
  ${CMAKE_CURRENT_SOURCE_DIR}/Benchmark_GuardMalloc.in
  ${CMAKE_CURRENT_BINARY_DIR}/Benchmark_GuardMalloc
  @ONLY)
configure_file(
  ${CMAKE_CURRENT_SOURCE_DIR}/Benchmark_RuntimeLeaksRunner.in
  ${CMAKE_CURRENT_BINARY_DIR}/Benchmark_RuntimeLeaksRunner
  @ONLY)
configure_file(
  ${CMAKE_CURRENT_SOURCE_DIR}/Benchmark_QuickCheck.in
  ${CMAKE_CURRENT_BINARY_DIR}/Benchmark_QuickCheck
  @ONLY)
configure_file(
  ${CMAKE_CURRENT_SOURCE_DIR}/Benchmark_DTrace.in
  ${CMAKE_CURRENT_BINARY_DIR}/Benchmark_DTrace
  @ONLY)
set(PATH_TO_DRIVER_LIBRARY)

file(COPY ${CMAKE_CURRENT_BINARY_DIR}/Benchmark_GuardMalloc
     DESTINATION "${swift-bin-dir}"
     FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
     GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

file(COPY ${CMAKE_CURRENT_BINARY_DIR}/Benchmark_RuntimeLeaksRunner
     DESTINATION "${swift-bin-dir}"
     FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
     GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

file(COPY ${CMAKE_CURRENT_BINARY_DIR}/Benchmark_QuickCheck
     DESTINATION "${swift-bin-dir}"
     FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
     GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

file(COPY ${CMAKE_CURRENT_BINARY_DIR}/Benchmark_DTrace
     DESTINATION "${swift-bin-dir}"
     FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
     GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/Benchmark_Driver
     DESTINATION "${swift-bin-dir}"
     FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
     GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/compare_perf_tests.py
     DESTINATION "${swift-bin-dir}"
     FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
     GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
